﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Spring.Aop;
using JCode.Common.Logging;

namespace JCode.Common
{
    public class AfterAdvice : IAfterReturningAdvice
    {

        public void AfterReturning(object returnValue, System.Reflection.MethodInfo method, object[] args, object target)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("后置通知--调用的方法名 : " + method.Name + "目标: " + target);
            sb.Append("参数为:");
            if (args != null)
            {
                foreach (object arg in args)
                {
                    sb.Append(arg);
                }
            }
            sb.Append("返回值:"+returnValue);

            Logger.Info(sb.ToString());
        }
    }
}
